#pragma once

namespace NXMFC
{

class rttIODevice
{
public:
    rttIODevice();
    ~rttIODevice();

public:
    bool open(const char *name, bool nonblock = false);
    void close();
    bool waitForReadyRead(int ms);
    int write(const void *buf, unsigned max);
    int read(void *buf, unsigned max);
    int readAll(void *buf, unsigned max, int timeout_ms = 20);
    int ioctl(int cmd, void *arg);

private:
    int fd;
};

}
